package com.maychat.config;

import com.maychat.enums.ContactType;

import java.util.Arrays;
import java.util.List;

public class Consts {
    public static final String REDIS_KEY_MAYCHAT_CAPTCHA_ANS = "maychat:captchaAnswer:";
    public static final String REDIS_KEY_MAYCHAT_WS_USER_CONN_HEART_BEAT = "maychat:ws:userConnHeartbeat:";
    public static final String REDIS_KEY_MAYCHAT_WS_USER_TOKEN = "maychat:ws:userToken:";
    public static final String REDIS_KEY_MAYCHAT_WS_USER_ID = "maychat:ws:userId:";
    public static final String REDIS_KEY_MAYCHAT_WS_USER_CONTACTS = "maychat:ws:user:contacts:";
    public static final String REDIS_KEY_MAYCHAT_SYSTEM_OPTIONS = "maychat:systemOptions:";


    public static final String AUTH = "Authorization";
    public static final String APP_NAME = "MayChat";
    public static final String FOLDER_FILE = "/file";
    public static final String FOLDER_FILE_AVATAR = FOLDER_FILE + "/avatar";
    public static final String FOLDER_FILE_VERSIONS = FOLDER_FILE + "/versions";
    public static final String IMAGE_SUFFIX = ".png";
    public static final String IMAGE_SMALL_SUFFIX = "_small.png";

    public static final String COVER_INFIX = "_cover";
    public static final String ROBOT_UID = ContactType.USER.getPrefix() + "robot";

    public static final Integer TIME_1MIN = 60;
    public static final Integer TIME_1DAY = TIME_1MIN * 24 * 60;
    public static final Integer TIME_1WEEK = TIME_1DAY * 7;
    public static final Long TIME_MS_3DAYS = TIME_1DAY * 3 * 1000L;

    public static final String REGEX_PASSWORD = "^[\\w]{6,18}$";

    // 图片文件扩展名
    public static final List<String> IMAGE_EXTS = Arrays.asList(".jpg", ".jpeg", ".png", ".gif", ".bmp");

    public static final String IMAGE_MIME = "image/*; charset=UTF-8";


    // 视频文件扩展名
    public static final List<String> VIDEO_EXTS = Arrays.asList(".mp4", ".avi", ".mkv", ".mov", ".webm");
    public static final String VIDEO_MIME = "video/*; charset=UTF-8";
    public static final String DEFAULT_MIME = "application/octet-stream; charset=UTF-8";

    public static final Long BYTES_PER_KB = 1024L;
    public static final Long BYTES_PER_MB = 1024L * 1024L;
}
